package cn.tannn.surenessdemo.user.entity;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * user-role mapping entity
 * @author tan
 * @date 2022-07-18 10:54:44
 */

@Entity
@Table(name = "auth_user_role_bind",indexes = {
        @Index(name = "user_role_inde",columnList = "userCode,roleCode",unique = true)
})
@org.hibernate.annotations.Table(appliesTo = "auth_user_role_bind", comment = "用户角色关联表")
@Getter
@Setter
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@DynamicInsert
public class AuthUserRoleBind extends CommonBean<AuthUserRoleBind> {


    @Column(columnDefinition="varchar(50) not null COMMENT '用户Code'")
    private String userCode;

    @Column(columnDefinition="varchar(50) not null COMMENT '角色Code'")
    private String roleCode;


}
